<div class="file-header">
    <div class="col-lg-12" style="padding-top: 15px;">
        <div class="btn-group">
            <button type="button" class="btn btn-success"
                    ng-click="create()"><i class="fa fa-plus"></i> 新建</button>
        </div>
        <div class="btn-group" ng-show="!deletable()">
            <button type="button" class="btn btn-primary"
                    ng-disabled="!resumeAble" ng-click="resume()">
                <i class="fa fa-download"></i> 下载
            </button>
            <button type="button" class="btn btn-primary"
                    ng-disabled="!pauseAble" ng-click="pause()">
                <i class="fa fa-pause"></i> 暂停
            </button>
            <button type="button" class="btn btn-danger"
                    ng-disabled="!deleteAble" ng-click="delete()">
                <i class="fa fa-times"></i> 删除
            </button>
        </div>
        <div class="btn-group">
            <button type="button" class="btn btn-default" ng-click="refresh()">
                <i class="fa fa-refresh"></i>
            </button>
        </div>
    </div>
</div>
<div class="col-lg-6">
    <div class="torrent-item" ng-class="{'checked': x.checked}" ng-click="chooseOne(x)" ng-repeat="x in status.torrents">
        <div class="title">{{x.name}}
            <div class="btn-group" style="float: right;">
                <button class="btn btn-default btn-xs" ng-click="destroy(x.infoHash)"><i class="fa fa-times"></i></button>
            </div>
        </div>
        <div class="progress">
            <div class="progress-bar" role="progressbar" style="width: {{x.progress*100}}%;"
                 aria-valuenow="{{x.progress}}" aria-valuemin="0" aria-valuemax="1" >
                <span class="sr-only">Complete</span>
            </div>
        </div>
        <div class="percent">{{byteToStr(x.downloaded)}} / {{byteToStr(x.size*1)}}
            <div class="state" ng-hide="x.state==0">{{torrentState(x.state)}}</div>
            <div class="speed" ng-show="x.state==0">{{x.downloadSpeed}} b/s</div>
        </div>

    </div>
</div>

<div class="modal fade" tabindex="-1" role="dialog" id="add-modal">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                <h4 class="modal-title">新建离线任务</h4>
            </div>
            <div class="modal-body">
                <div class="form" style="overflow: auto;">
                    <div class="form-group">
                        <buttom type="button" ng-disabled="uploadFiles" ng-click="select_files()" class="btn btn-warning btn-block">
                            上传BT文件</buttom>
                    </div>
                    <form class="form-inline" id="upload-form" ng-show="false" method="post" action="/files/upload/bt"
                          enctype="multipart/form-data">
                        <div class="form-group ">
                            <input type="file" id="select-image" name="image1" required="required">
                        </div>
                    </form>
                    <p style="color: grey;">暂不支持magnet下载。。。</p>
                    <!--<div class="form-group">
                        <input class="form-control" ng-model="magnet" type="text" placeholder="输入magnet地址" ng-keyup="input_magnet($event)"/>
                    </div>-->
                </div>
            </div>
        </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->